Devices and methods for managing memory buffers

ABSTRACT

A method for managing a pool buffers includes establishing a first buffer class with a first maximum allowable number of buffers, and a first reserved number of buffers that are reserved for the first buffer class in the pool of buffers even if no Input/Output (I/O) operation is running in connection with the first buffer class. The method includes establishing a second buffer class with a second maximum allowable number of buffers, and a second reserved number of buffers that are reserved for the second buffer class in the pool of buffers even if no I/O operation is running in connection with the second buffer class. The first buffer is enabled class to have more than the first maximum allowable number of buffers as long as a number of buffers allocated to the second buffer class is fewer than the second maximum allowable number of buffers.

FIELD OF THE DISCLOSURE

The present disclosure is generally directed to devices and methods formanaging memory buffers, for example, in a cached environment.

BACKGROUND

In a storage controller, a dynamic random access memory (DRAM) bufferpool is used to de-stage writes to memory devices, such as a hard diskdrive (HDD), a solid state drive (SSD), etc. to provide fast response tothe upper layers, and can also be used as a read cache. In a mixedtopology, where the storage controller is connected to both a solidstate drive (SSD) and an HDD (or some other fast and slow storagemediums) SSD and HDD Virtual Drives (VDs)s share the same DRAM bufferpool. Since SSD VDs can flush and de-stage data faster from DRAM,buffers corresponding to SSD VDs are freed up much faster than HDD VDs.These newly freed buffers can in turn be taken by incoming HDDinput/output (I/O) requests, which rapidly fills all of the buffers inthe pool and leads to severe starvation and lower performance for theSSDs.

Also, in many storage applications, there are workloads for which lowwrite latency takes priority. Typically, these are low queue depthworkloads, and the success of providing low latency depends on theavailability of free buffers for incoming writes. Thus, low latencyworkloads will suffer if other workloads use all the buffers in thepool, and the storage controller must wait for free buffers.

One way of addressing the above problem may be to introduce a hardpartition of the buffers between HDD, SSD and Low Latency workloads.However, this scheme is wasteful and suboptimal when any of the threeworkloads are either not present or idle. In that case, the reservedbuffers for each idle or unused workload are unutilized even though thebuffers could have been better utilized by some other workload that maybe starved for extra buffers. Accordingly, it is desired to introduce aflexible buffer management scheme that reacts smoothly and automaticallyto changes in buffer demand, which can lead to a reduction of wastedbuffer space.

BRIEF DESCRIPTION OF THE DRAWINGS

The present disclosure is described in conjunction with the appendedfigures, which are not necessarily drawn to scale:

FIG. 1 is a block diagram depicting a computing system in accordancewith at least one example embodiment;

FIG. 2 is a block diagram depicting details of an illustrativecontroller in accordance with at least one example embodiment;

FIGS. 3 and 4 illustrate various states of a buffer class according toat least one example embodiment;

FIGS. 5-7 illustrate a buffer borrowing scheme according to at least oneexample embodiment;

FIG. 8 illustrates example operations of a storage controller toaccording to at least one example embodiment; and

FIG. 9 illustrates example operations of a storage controller accordingto at least one example embodiment.

DETAILED DESCRIPTION

The ensuing description provides embodiments only, and is not intendedto limit the scope, applicability, or configuration of the claims.Rather, the ensuing description will provide those skilled in the artwith an enabling description for implementing the described embodiments.It being understood that various changes may be made in the function andarrangement of elements without departing from the spirit and scope ofthe appended claims.

Unless otherwise defined, all terms (including technical and scientificterms) used herein have the same meaning as commonly understood by oneof ordinary skill in the art to which this disclosure belongs. It willbe further understood that terms, such as those defined in commonly useddictionaries, should be interpreted as having a meaning that isconsistent with their meaning in the context of the relevant art andthis disclosure.

As used herein, the singular forms “a,” “an,” and “the” are intended toinclude the plural forms as well, unless the context clearly indicatesotherwise. It will be further understood that the terms “include,”“includes,” “including,” “comprise,” “comprises,” and/or “comprising,”when used in this specification, specify the presence of statedfeatures, integers, steps, operations, elements, and/or components, butdo not preclude the presence or addition of one or more other features,integers, steps, operations, elements, components, and/or groupsthereof. The term “and/or” includes any and all combinations of one ormore of the associated listed items.

With reference to FIGS. 1-9, various embodiments of the presentdisclosure will be described. While many of the examples depicted anddescribed herein will relate to a hybrid topology (HHD and SSD), itshould be appreciated that embodiments of the present disclosure are notso limited. Indeed, aspects of the present disclosure can be used in anytype of computing system and/or memory environment. In particular,embodiments of the present disclosure can be used in any type of cachingscheme (whether employed by a HDD/SSD storage controller or some othertype of device used in a communication system). In particular, harddrives, hard drive controllers (e.g., SCSI controllers, SAS controllers,RAID controllers, etc.) may be configured to implement exampleembodiments. As another example, network cards or the like having cachememory may also be configured to implement example embodiments.

With reference now to FIG. 1, details of a computing system 100 capableof implementing a buffer management scheme according to exampleembodiments will be described. The computing system 100 is shown toinclude a host system 104, a controller (or storage controller) 108(e.g., a HDD/SSD controller, a SCSI controller, a SAS controller, a RAIDcontroller, etc.), and a storage array 112 having a plurality of storagedevices 136 a-N therein. The system 100 may utilize any type of datastorage architecture. The particular architecture depicted and describedherein (e.g., a mixed HDD/SSD architecture) should not be construed aslimiting example embodiments. If implemented as a RAID architecture,however, it should be appreciated that any type of RAID scheme may beemployed (e.g., RAID-0, RAID-1, RAID-2, . . . , RAID-5, RAID-6, etc.).

One or more of the storage devices 136 a-N may also be used to storeerror correction or parity information. In each row, one of the storagedevices 136 a-N is assigned to store a certain checksum, a so calledparity function, which is calculated based on the data from other memberdisks in the row. In case of a single disk failure, the missing data canbe calculated using the parity. In such a way fault tolerance isprovided.

Theoretically, the maximum number of the storage devices/disks is notlimited, but in practice, one takes into account the controllercapacity. The capacity of the array is (N−1) times the size of thesmallest member storage device/disk for the array of N storagedevices/disks. Thus, the capacity of one storage device/disk is used tostore the parity function data to provide fault tolerance.

One of the functions of the controller 108 is to make the multiplestorage devices 136 a-N in the array 112 appear to a host system 104 asa single high capacity disk drive. Thus, the controller 108 may beconfigured to automatically distribute data supplied from the hostsystem 104 across the multiple storage devices 136 a-N (potentially withparity information) without ever exposing the manner in which the datais actually distributed to the host system 104.

In the depicted embodiment, the host system 104 is shown to include aprocessor 116, an interface 120, and memory 124. It should beappreciated that the host system 104 may include additional componentswithout departing from the scope of example embodiments. The host system104, in some embodiments, corresponds to a user computer, laptop,workstation, server, collection of servers, or the like. Thus, the hostsystem 104 may or may not be designed to receive input directly from ahuman user.

The processor 116 of the host system 104 may include a microprocessor,central processing unit (CPU), collection of microprocessors, or thelike. The memory 124 may be designed to store instructions that enablefunctionality of the host system 104 when executed by the processor 116.The memory 124 may also store data that is eventually written by thehost system 104 to the storage array 112. Further still, the memory 124may be used to store data that is retrieved from the storage array 112.Illustrative memory 124 devices may include, without limitation,volatile or non-volatile computer memory (e.g., flash memory, RAM, DRAM,ROM, EEPROM, etc.).

The interface 120 of the host system 104 enables the host system 104 tocommunicate with the controller 108 via a host interface 128 of thecontroller 108. In some embodiments, the interface 120 and hostinterface(s) 128 may be of a same or similar type (e.g., utilize acommon protocol, a common communication medium, etc.) such that commandsissued by the host system 104 are receivable at the controller 108 anddata retrieved by the controller 108 is transmittable back to the hostsystem 104. The interfaces 120, 128 may correspond to parallel or serialcomputer interfaces that utilize wired or wireless communicationchannels. The interfaces 120, 128 may include hardware that enables suchwired or wireless communications. The communication protocol usedbetween the host system 104 and the controller 108 may correspond to anytype of known host/memory control protocol. Non-limiting examples ofprotocols that may be used between interfaces 120, 128 include SAS,SATA, SCSI, FibreChannel (FC), iSCSI, ATA over Ethernet, InfiniBand, orthe like.

The controller 108 may provide the ability to represent the entirestorage array 112 to the host system 104 as a single high volume datastorage device. Any known mechanism can be used to accomplish this task.The controller 108 may help to manager the storage devices 136 a-N(which can be hard disk drives, sold-state drives, or combinationsthereof) so as to operate as a logical unit. In some embodiments, thecontroller 108 may be physically incorporated into the host device 104as a Peripheral Component Interconnect (PCI) expansion (e.g., PCIexpress (PCI)e) card or the like. In such situations, the controller 108may be referred to as a RAID adapter. Example embodiments also apply tosingle drives exposed as is to a host, but that has a DRAM cache.

The storage devices 136 a-N in the storage array 112 may be of similartypes or may be of different types without departing from the scope ofthe present disclosure. The storage devices 136 a-N may be co-locatedwith one another or may be physically located in different geographicallocations. The nature of the storage interface 132 may depend upon thetypes of storage devices 136 a-N used in the storage array 112 and thedesired capabilities of the array 112. The storage interface 132 maycorrespond to a virtual interface or an actual interface. As with theother interfaces described herein, the storage interface 132 may includeserial or parallel interface technologies. Examples of the storageinterface 132 include, without limitation, SAS, SATA, SCSI, FC, iSCSI,ATA over Ethernet, InfiniBand, or the like.

The controller 108 is shown to have communication capabilities with acontroller cache 140. While depicted as being separate from thecontroller 108, it should be appreciated that the controller cache 140may be integral to the controller 108, meaning that components of thecontroller 108 and the controller cache 140 may be contained within asingle physical housing or computing unit (e.g., server blade). Thecontroller cache 140 is provided to enable the controller 108 to performcaching operations. The controller 108 may employ caching operationsduring execution of I/O commands received from the host system 104.Depending upon the nature of the I/O command and the amount ofinformation being processed during the command, the controller 108 mayrequire a large number of cache memory modules 148 or a smaller numberof cache memory modules 148. The memory modules 148 may correspond toflash memory, RAM, DDR memory, or some other type of computer memorythat is quickly accessible and can be rewritten multiple times. Thenumber of separate memory modules 148 in the controller cache 140 istypically larger than one, although a controller cache 140 may beconfigured to operate with a single memory module 148 if desired.According to example embodiments, each memory module 148 may include aplurality of buffers (collectively referred to as a pool of buffers) andcorrespond to a particular buffer class. However, example embodimentsare not limited thereto. For example, a buffer class may span acrossmultiple memory modules 148 and/or multiple buffer classes may reside ina single memory module 148. The controller 108 implements one or morebuffer management schemes to control allocation of the buffers in eachbuffer class and across buffer classes. FIGS. 2-9 describe a buffermanagement scheme in more detail below.

The cache interface 144 may correspond to any interconnect that enablesthe controller 108 to access the memory modules 148, temporarily storedata thereon, and/or retrieve data stored thereon in connection withperforming an I/O command or some other executable command. In someembodiments, the controller cache 140 may be integrated with thecontroller 108 and may be executed on a CPU chip or placed on a separatechip within the controller 108. In such a scenario, the interface 144may correspond to a separate bus interconnect within the CPU or tracesconnecting a chip of the controller cache 140 with a chip executing theprocessor of the controller 108. In other embodiments, the controllercache 140 may be external to the controller 108 in which case theinterface 144 may correspond to a serial or parallel data port.

With reference now to FIG. 2 additional details of a controller 108 willbe described in accordance with at least one example embodiment. Thecontroller 108 is shown to include the host interface(s) 128 and storageinterface(s) 132. The controller 108 is also shown to include aprocessor 204, memory 208 (e.g., a main controller memory), one or moredrivers 212, and a power source 216.

The processor 204 may include an Integrated Circuit (IC) chip ormultiple IC chips, a CPU, a microprocessor, or the like. The processor204 may be configured to execute instructions in memory 208 that areshown to include a host I/O manager 232, a buffer manager 248, a cachemanager 252, a RAID manager 256, and a SAS manager 260. Furthermore, inconnection with performing caching or buffer functions, the processor204 may utilize buffer memory 220. The host I/O manager 232 is shown toinclude a plurality of sub-routines that include, without limitation, ahost message unit 236, a command extraction unit 240, and a completionengine 244.

Each of the components (e.g., host I/O manager 232, buffer manager 248,cache manager 252, RAID manager 256, and SAS manager 260) may correspondto different functional blocks that operate in their own local memoryloading the global memory (e.g. a global buffer memory 220 or memory208) on an as-needed basis. Each of these different functional blockscan be accelerated by different hardware threads without departing fromthe scope of example embodiments.

The memory 208 may be volatile and/or non-volatile in nature. Asindicated above, the memory 208 may include any hardware component orcollection of hardware components that are capable of storinginstructions and communicating those instructions to the processor 204for execution. Non-limiting examples of memory 208 include RAM, ROM,flash memory, EEPROM, variants thereof, combinations thereof, and thelike. Similarly, the buffer memory 220 may be volatile or non-volatilein nature. The buffer memory may be configured for multiple read/writesand may be adapted for quick access by the processor 204.

The instructions stored in memory 208 are shown to be differentinstruction sets, but it should be appreciated that the instructions canbe combined into a smaller number of instruction sets without departingfrom the scope of example embodiments. The host I/O manager 232, whenexecuted, enables the processor 204 to manage I/O commands received fromthe host system 104 and facilitate higher-level communications with thehost system 104. In some embodiments, the host I/O manager 232 mayutilize the host message unit 236 to process incoming messages receivedfrom the host system 104. As a non-limiting example, the controller 108may receive messages from the host system 104 in an MPI protocol. Thehost message unit 236 may bring down the messages received from the hostsystem 104 and pass the content of the messages to the commandextraction unit 240. The command extraction unit 240 may be configuredto determine if a particular command in a message is accelerable (e.g.,capable of being passed to a particular functional block to facilitatehardware acceleration). If a command is determined to be accelerable,then the command extraction unit 240 may implement a hardwareacceleration process and generate an appropriate Local Message ID (LMID)that represents all of the information received from the host system 104(in the command). The LMID effectively represents the command receivedfrom the host system 104, but is in a different format that isunderstandable by the managers 248, 252, 256, 260. The commandextraction unit 240 may, in some embodiments, route the various commands(e.g., LMIDs) to one or more of the buffer manager 248, cache manager252, RAID manager 256, and SAS manager 260. The routing of the commandsmay depend upon a type of the command and the function to be executed.The completion engine of the host I/O manager 232 may be responsible forreporting to the host system 104 that an I/O command has been completedby the controller 108.

The buffer manager 248 may include instructions that, when executed,enable the processor 204 to perform various buffer functions. As anexample, the buffer manager 248 may enable the processor 204 torecognize a write command and utilize the buffer memory 220 inconnection with executing the write command. In some embodiments, anycommand or function that leverages the buffer memory 220 may utilize thebuffer manager 248.

The cache manager 252 may include instructions that, when executed,enable the processor 204 to perform various caching functions. As anexample, the cache manager 252 may enable the processor 204 to respondto read commands. The cache manager 252 may also enable the processor204 to communicate with the controller cache 140 and leverage the memorymodules 148 of the controller cache 140. The cache manager 252 may alsomanage the creation and lifecycle of cache frame anchors for rows 228,cache frame anchors for strips 230, and/or ISGLs 224. As an example, ascaching functions are executed, one or more data structures 228, 230 maybe created or utilized to facilitate the caching function.

The RAID manager 256 and/or SAS manager 260 may include instructionsthat, when executed, enable the processor 204 to communicate with thestorage array 112 or storage devices 136 therein. In some embodiments,the RAID manager 256 and/or SAS manager 260 may receive commands eitherdirectly from the host I/O manager 232 (if not caching was needed) orthey may receive commands from the cache manager 252 after anappropriate caching process has been performed. When invoked, the RAIDmanager 256 and/or SAS manager 260 may enable the processor 204 tofinalize read or write commands and exchange data with the storage array112.

The driver(s) 212 may comprise firmware, hardware, software, orcombinations thereof that enable the processor 204 to make use of otherhardware components in the controller 108. For instance, differentdrivers 212 may be provided to support functions of the interfaces 128,132. As another example, separate drivers 212 may be provided to supportfunctions of the buffer memory 220. The drivers 212 may perform thelow-level routines that allow the processor 204 to communicate with theother hardware components and respond to commands received from theprocessor 204.

The power source 216 may correspond to hardware components that providethe controller 108 with the power necessary to run the processor 204 andother components. As an example, the power source 216 may correspond toa power converter that receives AC power from an external source (e.g.,a power outlet) and converts the AC power into DC power that is useableby the other hardware components of the controller 108. Alternatively oradditionally, the power source 216 may correspond to an internal powersource (e.g., a battery pack, bank of capacitors, etc.) that providespower to the hardware components of the controller 108.

One or more registers 262 are used to track various aspects of thebuffer management scheme in accordance with example embodiments. Forexample, the registers 262 set and/or track the number of buffers withineach classification of regions of buffers and set and/or track a lendingpolicy associated with a buffer class, as described in more detailbelow. Although registers 262 are shown as being part of the controller108, it should be understood that the registers may be providedseparately from the controller 108, such as in the controller cache 140if the controller cache 140 is separate from the controller 108.

FIGS. 3-7 illustrate aspects of a buffer management scheme in accordancewith at least one example embodiment. The buffer management scheme maybe implemented by the processor 204 executing buffer manager routines248. As noted above, the memory modules 148 include a plurality ofbuffers and each memory module 148 may correspond to one of a pluralityof buffer classes. Further, the processor 204 executes buffer managerroutines 248 to control allocation of the buffers within and across theplurality of buffer classes.

For the sake of description, FIGS. 3-7 illustrate four Buffer Classes0-3, which may be associated with fast, medium, slow, and low-latencyI/O operations, respectively. However, example embodiments can apply toany number of buffer classes associated with any type of I/O operation.Regardless of their association to a type of I/O operation, the bufferclasses are controlled using the same logic, but can be configureddifferently by the processor 204.

FIGS. 3-7 are described with reference to several terms that have thefollowing definitions. Assuming there are n buffer classes, the bufferclasses will have the following initial configurations/variables (e.g.,accomplished using registers set by firmware of the system).

Allowance[n]: Allowance refers to the initial number of buffers assignedto a particular buffer class (or a maximum allowable number of buffersallocatable to the buffer class). A buffer class has this many buffersearmarked initially, and if the buffer class requests more buffers, therequesting buffer class can borrow from the allowance of another bufferclass based on rules if there are buffers to spare (discussed in furtherdetail with reference to FIGS. 3-7). That is, the requesting bufferclass may be allowed to exceed the allowance (or maximum allowablenumber of buffers). A number of “allocatable” buffers indicates a numberof buffers available to be allocated (see definition of allocatedbelow). The allowance may be a design parameter set based on empiricalevidence and/or user preference.

Reserved[n]: Even if no I/O operations are running, a given number ofreserved buffers are present for each buffer class. Thus, the reservedbuffers in each buffer class are untouchable and are not available to beborrowed by other buffer classes. Reserved buffers ensure that even if abuffer class is idle for a period of time and then reactivates, thebuffer class is guaranteed to immediately have least this many buffersavailable for I/O operations. The reserved number of buffers may be adesign parameter set based on empirical evidence and/or user preference.

Allocated[n]: The allocated number of buffers is the number of buffersallocated to a given buffer class at any given time. This is the actualnumber of buffers being used by the buffer class. The allocated numberof buffers can exceed the number of buffers in the allowance, asdescribed in more detail below.

Guaranteed[n]: Guaranteed buffers are used when a buffer class is activeand using more buffers than the reserved buffer count. The guaranteedbuffers function as “head room” in front of the current allocation for abuffer class or the initial buffer allowance. There is an initialsetting for the number of guaranteed buffers, but as buffers areallocated and buffer classes reach their allowance, the numberguaranteed buffers shrinks, eventually becoming zero when a number ofallocated buffers is equal to a number of buffers in the allowance.Guaranteed buffers are usually not available to be borrowed by otherbuffer classes. The guaranteed number of buffers may be a designparameter set based on empirical evidence and/or user preference.

Protected[n]: Protected buffers work as another layer in front of theguaranteed buffers. Similar to guaranteed buffers, there is an initialsetting for the number of protected buffers, but as buffers areallocated and reach the allowance, the number of protected buffersshrinks, eventually becoming zero when a number of allocated buffers isequal to a number of buffers in the allowance minus the number ofguaranteed buffers. While other buffer classes can borrow from protectedbuffers of a different buffer class, there are rules for allowing otherbuffer classes to do so. The protected number of buffers may be a designparameter set based on empirical evidence and/or user preference.

Unprotected[n]: Unprotected buffers are lendable with none or fewer ofthe limitations imposed on protected and guaranteed buffers. A bufferclass begins allocating buffers from unprotected buffers beforeallocating from the protected and guaranteed buffers. The unprotectednumber of buffers may be a design parameter set based on empiricalevidence and/or user preference.

It should be understood that the terms allowance, reserved, allocated,guaranteed, protected, and unprotected are classifications of types ofbuffers within each buffer class. The number of buffers in eachclassification is tracked and/or set for each buffer class using theregisters 262.

BuffersToBeReturned[n]: When a buffer class exceeds its allowance, thebuffer class should return some buffers in order to get more buffers.This value can be variable and dynamically calculated based on anapplied lending policy, empirical evidence, and/or user preference, andis stored in a register 262 to remember the number of buffers a givenbuffer class should to return before the buffer class gets a newallocation.

Buffers are generally “lendable” (or able to be borrowed) when a bufferclass has unprotected or protected buffers remaining. Buffers aregenerally not “lendable” when a buffer class is in its guaranteed range.

In view of the above, it may be said that there is a relationshipbetween configured numbers of buffers, an allocated amount, and lendableamount. That is, as a buffer class uses up its allowance of buffers, itsunprotected region shrinks to zero, then its protected region shrinks tozero, then its guaranteed region shrinks to zero.

When a buffer class has allocated fewer buffers than the reservedamount, the buffer class has not yet established its guaranteed numberof buffers. This allows other buffer classes to borrow more buffers froman inactive or mostly inactive buffer class.

As noted above, in order to implement a buffer management schemeaccording to at least one example embodiment, the controller 108 mayinclude counters (e.g., registers 262) for quality of service (QoS)manager internal use.

For the sake of convenient explanation, FIGS. 3-7 are illustrated anddescribed as if buffer borrowing occurs between buffer classes. However,it should be understood that borrowing occurs from a total pool ofavailable buffers, not necessarily from a specific buffer class. Forexample, in FIGS. 3-7, it should be understood that Buffer Class 0borrows buffers from the total pool available buffers, not necessarilyfrom a specific buffer class. That is, in Buffer Class 1 of FIG. 7, theguaranteed number of buffers is not yet in use by Buffer Class 1, but isstill in the total pool of available buffers and earmarked as being forthe guaranteed buffers of Buffer Class 1. Accordingly, unallocatedbuffers (i.e., buffers not currently in use) throughout FIGS. 3-7 shouldbe understood as being earmarked for a particular Buffer Class, butstill in the total pool of buffers that may be available to other bufferclasses for borrowing.

As noted above, the buffer management scheme follows a set of rules formanaging the buffer classes. FIGS. 3-7 make reference to various policesthat represent the set of rules. Example embodiments are described withreference to three policies (defined below), but it should be understoodthat any number of policies may be implemented based on designpreferences.

As long as a buffer class is below its allowance, the buffer class canallocate new buffers without any problems. However, the moment thenumber of allocated buffers reaches the number of allowance buffers,whether the buffer class can allocate new buffers depends the followingpolices, (or lending policies) defined below.

Lending Policy 1 is applied to a borrow request when a requesting bufferclass is at/above its allowance, but there is at least one other bufferclass that has buffers in an unprotected state. Lending Policy 1 is theleast restrictive policy.

Lending Policy 2 is applied to a borrow request when a requesting bufferclass is at/above allowance, at least one other buffer class has buffersin a protected state, and no other buffer class has buffers in anunprotected state. Lending Policy 2 is more restrictive than LendingPolicy 1 but less restrictive than Lending Policy 3.

Lending Policy 3 is applied to a borrow request when a requesting bufferclass is at/above allowance, and at least one other buffer class has aguaranteed region squeezed (or shrunk) because another buffer classborrowed buffers. Lending Policy 3 is the most restrictive policy.

Each lending policy defines for a given number of requested buffers, howmany buffers the requesting buffer class (which is over its allowance)must return in order to allocate more buffers (i.e., receive morebuffers from the total pool of available buffers).

Lending Policy 1 is the least restrictive, so the amount of buffersneeded to be returned by the requesting buffer class can be a smallfraction of the total requested. For example, for a requesting bufferclass to receive an additional 100 buffers, Lending Policy 1 may requirethat the requesting buffer class return 10 buffers. According to atleast one example embodiment, the ratio of returned buffers to requestedbuffers is a power of 2. Thus, for a request of 100 additional buffers,Lending Policy 1 may require that the requesting buffer class return ¼or ½, etc. of the requested number of buffers (i.e., return 25 buffers,50 buffers, etc.). Keeping the ratio as a power of 2 facilitatesoperation of the system hardware.

Lending Policy 2 is more restrictive than Lending Policy 1, but stillallows a buffer class to grow. For example, Lending Policy 2 may requirethat for receiving 100 additional buffers, 50 buffers need to bereturned by the requesting buffer class.

Lending Policy 3 is applied when one buffer class (e.g., buffer class A)has already borrowed buffers and is above its allowance, but now anotherbuffer class (e.g., buffer class B, which is below its allowance)requests additional buffers and wants to grow. If this pushes bufferclass B inside its guaranteed region, and then buffer class A mustshrink and make buffers available for buffer class B. This is ensured byforcing buffer class A to return more buffers than its demand. Forexample, if buffer class A requests 100 buffers, Lending Policy 3 mayrequire buffer class A to return 150 buffers before receiving the 100buffers.

It should be understood that the details of the Lending Policies areadjustable design parameters that are based on empirical evidence and/oruser defined, and can be tracked and/or set using registers 262.

FIGS. 3 and 4 illustrate various states of a buffer class according toat least one example embodiment. FIGS. 3 and 4 illustrate seven bufferstates, States 1-7, of a single buffer class, but example embodimentsare not limited thereto, and there may be fewer or more buffer states asdesired. A buffer class may encounter one, some, or all of States 1-7depending on the buffer management scheme being employed.

In State 1, the buffer class includes an allowance or a maximumallowable number of buffers that are allocatable (indicated by the“Allowance” arrow) to the buffer class and a reserved number of bufferslabeled “Reserved” and has no buffers allocated from the pool ofbuffers. That is, the buffer class is idle or inactive and is notcurrently using any buffers from the pool (indicated by the Allocatedarrow being at the bottom of the buffer class). Thus, State 1 shows alarge region labeled “Lendable” from which other buffer classes mayborrow buffers. All buffers except for those in the “Reserved” regionare lendable. While the number of allocated buffers is fewer than thenumber of reserved buffers, the effective guaranteed buffers are equalto the number of reserved buffers minus the number of allocated buffers.In other words, a number of guaranteed buffers has not yet beenestablished in State 1. Meanwhile, the effective protected buffers isequal to zero. That is, the lendable region may comprise unprotectedbuffers.

State 2 illustrates a buffer class state where a portion of the reservedbuffers have been allocated (i.e., are in use) while the remainingbuffers are identified as “Lendable.” As in State 1, all buffers exceptfor those in the “Reserved” region are lendable and a number ofguaranteed buffers has not yet been established.

State 3 illustrates a buffer class in which a number of allocatedbuffers is more than the reserved number of buffers but less than theallowance. State 3 further shows the establishment of unprotected,protected, and guaranteed buffers. Here, a sum of the allocated buffers,guaranteed buffers, and protected buffers is less than the allowance dueto the presence of unprotected buffers. In State 3, the protected andunprotected buffers are lendable, but lending begin from the unprotectedbuffers before progressing to the protected buffers. Thus, the effectivenumber of guaranteed buffers and the effective number of protectedbuffers are equal to the initial number of guaranteed buffers and theinitial number of protected buffers because borrowing from these regionshas not yet occurred.

State 4 illustrates a buffer class state in which the unprotectedbuffers from State 3 are now allocated to the buffer class so that a sumof the allocated, guaranteed, and protected buffers is equal to theallowance. In State 4, the protected buffers are lendable and the numberof guaranteed and protected buffers has been maintained from State 3.

With reference to FIG. 4, State 4 in FIG. 4 is the same as State 4 fromFIG. 3, but is reproduced for convenience of explanation. FIG. 4 showsstates of a buffer class at the buffer class progresses from using upits unprotected amount of buffers to using most of its guaranteed amountof buffers (progression is again right to left).

State 5 illustrates that the buffer class has begun to allocateadditional buffers from the protected buffers such that the number ofprotected buffers is fewer than the number of protected buffers in State4. Thus, a sum of the allocated and guaranteed buffers is less than theallowance. A number of effective guaranteed buffers is still the same asin State 4, but a number of effective protected buffers is fewer than inState 4. For example, the number of effective protected buffers is theallowance minus a sum of the allocated and guaranteed buffers.

State 6 shows that the buffer class has allocated all of its reserved,unprotected and protected buffers so that a sum of the allocated buffersand the guaranteed buffers is equal to the allowance. Here, the bufferclass has no lendable buffers and a number of effective guaranteedbuffers is the same as in States 4 and 5.

State 7 illustrates that the buffer class has begun to allocateadditional buffers from the guaranteed buffers, which are fewer comparedto State 6. Thus, a number of allocated buffers is less than theallowance and a number of effective guaranteed buffers is the allowanceminus the number of guaranteed buffers. As in State 6, the buffer classhas no lendable buffers.

FIGS. 5-7 illustrate a buffer borrowing (or lending) scheme according toat least one example embodiment. FIGS. 5-7 illustrate a buffer borrowingscheme for four Buffer Classes 0-3, but example embodiments are notlimited thereto, and the buffer borrowing scheme may be employed withfewer or more buffer classes as desired. For example, FIGS. 5-7illustrate a progression of states of the Buffer Classes 0-3 as BufferClass 0 requests additional buffers over its allowance.

In FIG. 5, Buffer Class 0 has allocated its allowance and has begun toborrow buffers from the pool of buffers. Here, Buffer Class 1 hasallocated all of its protected and unprotected buffers such that nolendable buffers exist. However, the allocations of Buffer Classes 2 and3 are such that these two classes still have lendable buffers availablein their respective number of protected buffers. Thus, Buffer Class 0borrows buffers from the pool of buffers earmarked for each protectedregion of Buffer Classes 2 and 3. Because Buffer Classes 2 and 3 havelendable buffers in their protected buffers, Policy 1 (or Lending Policy1) applies to these classes. FIG. 5 may be summarized as follows.

Before the borrow: Buffer Class 1 has no lendable buffers; and BufferClass 2 and Buffer Class 3 have lendable buffers so Lending Policy 1applies.

After the borrow: Buffer Class 2 remains in Lending Policy 1; BufferClass 3 remains in Lending Policy 1; Buffer Class 2 and Buffer Class 3still have lendable buffers remaining.

In FIG. 6, Buffer Class 0 continues to exceed its allowance and toborrow buffers from the pool of buffers.

Before the borrow, Buffer Class states are the same as after the borrowshown in FIG. 5. That is, lendable buffers exist in both Buffer Class 2and Buffer Class 3 before the borrow.

After the borrow: Buffer Class 2 has transitioned from Lending Policy 1to Lending Policy 2 because all of the lendable buffers are beingborrowed by Buffer Class 0; Buffer Class 3 remains in Lending Policy 1because Buffer Class 3 still has lendable buffers in the number ofprotected buffers. Since at least one buffer class (i.e., Buffer Class3) is in Lending Policy 1, Lending Policy 1 will be applied again whenBuffer Class 0 tries to borrow again.

In FIG. 7, Buffer Class 0 continues to exceed its allowance and toborrow buffers.

Before the borrow: lendable buffers are only in Buffer Class 3 (as inFIG. 6).

After the borrow: Buffer Class 2 remains in Lending Policy 2; BufferClass 3 transitions to Lending Policy 3 because all of its lendablebuffers are being borrowed by Buffer Class 0; and no lendable buffersremain in any buffer class.

FIG. 7 illustrates a case where Buffer Class 0 is allowed to borrow morebuffers because there were lendable buffers before the borrow, but theamount borrowed by Buffer Class 0 encroaches into the guaranteed numberof buffers for Buffer Class 3. This happens only when a lending bufferclass (e.g., Buffer Class 3) allocates some more buffers itself, thussqueezing the guaranteed region against the borrowed portion. That is,after the borrow, the guaranteed number of buffers in Buffer Class 3 isfewer than the number of guaranteed buffers shown in FIG. 6 for BufferClass 3.

In FIGS. 5-7, it should be understood that the Lending Policiesassociated with Buffer Classes 2 and 3 place limits on the requestingBuffer Class 0. That is, if Buffer Class 0 requests additional buffersfrom the pool of buffers that affect the ability of the pool of buffersto fulfill a buffer classification (e.g., protected, guaranteed, etc.)of Buffer Classes 2 and 3, then Buffer Class 0 must return a givennumber of buffers to the pool before being allowed to borrow theadditional buffers that are otherwise earmarked for Buffer Classes 2 and3.

FIG. 8 illustrates example operations for a buffer management schemecarried out by the controller in FIG. 1.

FIG. 8 is a flow diagram of a method for operating the controller 108described with respect to FIGS. 1-7. While a general order for the stepsof the method is shown in FIG. 8, the method can include more or fewersteps or can arrange the order of the steps differently than those shownin FIG. 8. Generally, the method starts at operation 800 and ends atoperation 835. The method can be executed as a set ofcomputer-executable instructions executed by the controller 108 andencoded or stored on a computer readable medium. Alternatively, theoperations discussed with respect to FIG. 8 may be implemented by thevarious elements of the controller 108 described with respect to FIGS.1-7. Hereinafter, the FIG. 8 shall be explained with reference to thesystems, components, assemblies, devices, user interfaces, environments,software, etc. described in conjunction with FIGS. 1-7.

In operation 800, the controller 108 provides a pool of buffers, forexample in the memory modules 148 of the controller cache 140 in FIG. 1.The pool of buffers comprises a plurality of buffers that areallocatable to a number of different buffer classes (e.g., BufferClasses 0-3).

In operation 805, the controller 108 establishes (or assigns), from thepool of buffers, a first buffer class that includes a first maximumallowable number of buffers that are allocatable thereto from the poolof buffers. The first buffer class further comprises a first reservednumber of buffers that are reserved for the first buffer class in thepool of buffers even if no Input/Output (I/O) operation is running inconnection with the first buffer class.

In operation 810, the controller 108 establishes a second buffer classthat includes a second maximum allowable number of buffers that areallocatable thereto from the pool of buffers. The second buffer classfurther comprises a second reserved number of buffers that are reservedfor the second buffer class in the pool of buffers even if no I/Ooperation is running in connection with the second buffer class.

In operation 815, the controller 108 establishes a third buffer classthat includes a third maximum allowable number of buffers that areallocatable thereto from the pool of buffers. The third buffer classfurther comprises a third reserved number of buffers that are reservedfor the third buffer class in the pool of buffers even if no I/Ooperation is running in connection with the third buffer class.

In operation 820, the controller 108 establishes a fourth buffer classthat includes a fourth maximum allowable number of buffers that areallocatable thereto from the pool of buffers. The fourth buffer classfurther comprises a fourth reserved number of buffers that are reservedfor the fourth buffer class in the pool of buffers even if no I/Ooperation is running in connection with the fourth buffer class.

In operation 825, the controller 108 determines whether at least one ofthe buffer classes comprises a reserved number of buffers that is fewerthan the respective maximum allowable number of buffers.

If so, in operation 830, the controller 108 enables one or more of thefirst, second, third, and fourth buffer classes to freely borrow buffersfrom one another so that one or more of the buffer classes is allowed tohave more than the respective maximum allowable number of buffers.

If not, in operation 835, the controller 108 does not enable one or moreof the first, second, third, and fourth buffer classes to freely borrowbuffers from one another. That is, a buffer class requesting to borrowbuffers above its allowance is not allowed to have more than therespective maximum allowable number of buffers.

According to at least one example embodiment, the first, second, third,and fourth buffer classes are allocated for fast, medium, slow, andlow-latency buffer operations (e.g., I/O operations), respectively.Further, the first, second, third, and/or fourth maximum allowablenumber of buffers are dynamically configurable by firmware of thecontroller 108 based on I/O activity of the first, second, third, and/orfourth buffer classes.

In some embodiments, third and fourth buffer classes are not desired. Inthis case, the third and fourth buffer classes are not established(i.e., the controller 108 skips operations 815 and 820), and operation830 includes enabling the first buffer class to have more than the firstmaximum allowable number of buffers allocated thereto from the pool ofbuffers as long as a number of buffers allocated to the second bufferclass is fewer than the second maximum allowable number of buffers.

FIG. 9 illustrates example operations for a buffer management schemecarried out by the controller in FIG. 1.

FIG. 9 is a flow diagram of a method for operating the controller 108described with respect to FIGS. 1-8. While a general order for the stepsof the method is shown in FIG. 8, the method can include more or fewersteps or can arrange the order of the steps differently than those shownin FIG. 9. Generally, the method starts at operation 900 and ends atoperation 935. The method can be executed as a set ofcomputer-executable instructions executed by the controller 108 andencoded or stored on a computer readable medium. Alternatively, theoperations discussed with respect to FIG. 9 may be implemented by thevarious elements of the controller 108 described with respect to FIGS.1-8. Hereinafter, the FIG. 9 shall be explained with reference to thesystems, components, assemblies, devices, user interfaces, environments,software, etc. described in conjunction with FIGS. 1-8.

Once a buffer class is enabled to have more than its respective numberof maximum allowable number of buffers in operation 830, the controllerm108 may carry out the operations of FIG. 9.

In operation 900, the controller 108 receives a buffer allocationrequest from one or more buffer classes (a requesting buffer class) toallocate more buffers.

In operation 905, the controller 108 determines whether the requestingbuffer class is over its respective allowance or whether fulfilling therequest will cause the buffer class to exceed its allowance. If not, thecontroller performs operation 930, described in more detail below. Ifso, the controller performs operation 910 to check the status of otherbuffer classes to determine a Lending Policy (see FIGS. 5-7).

In operation 915, the controller 108 applies the determined LendingPolicy, and in operation 915, the requesting buffer class returnsbuffers in accordance with the Lending Policy. For example, therequesting buffer class returns buffers as part of a next I/O operation.

In operation 925, the controller 108 determines whether the requestingbuffer class has returned enough buffers to proceed with fulfilling theallocation request. For example, the controller 108 determines whetherthe requesting buffer class returned the number of buffers indicated bythe Lending Policy. If so, the controller 108 proceeds to operation 930to allocate buffers from the pool of buffers to the requesting bufferclass. If not, then the controller 108 returns to operation 920.

In the event that operation 910 reveals that a Lending Policy does notapply (e.g., when the allocated buffers of all other buffers classes arebelow their respective allowances), then the controller skips operations915, 920, and 925.

In operation 935, the controller 108 updates the registers 262 based onthe new configuration of buffer classes. As noted above, the registers262 are used to track and/or set the classifications of buffers (e.g.,guaranteed, protected, unprotected, etc.) within each buffer class, andto track and/or set various lending policies. For example, the registersmaintain at least one of i) one or more buffer lending policies inconnection with one or more of the first, second, third, and fourthbuffer classes; ii) a buffer-to-be-returned count for each of the one ormore buffer lending policies that indicates a number of buffers thatneed to be returned to the pool of buffers before a buffer class isallowed to have more buffers allocated thereto; iii) a number ofguaranteed buffers for the first, second, third, and/or fourth bufferclasses, respectively; iv) a buffer allocation count for each of thefirst, second, third, and/or fourth buffer classes that indicates acurrent number of buffers allocated to the first, second, third, and/orfourth buffer classes from the pool of buffers, respectively; and v) anumber of protected buffers for the first, second, third, and/or fourthbuffer classes, respectively.

The one or more buffer lending policies enable buffer lending betweenbuffer classes even if a buffer class has more buffers allocated theretothan is allowed by the respective maximum allowable number of buffers.The number of guaranteed buffers is changeable in response to an amountof I/O activity experienced by the first, second, third, and fourthbuffer classes. In one embodiment, the number of guaranteed buffers isgreater than the reserved number of buffers for each buffer class. Thenumber of protected buffers are changeable in response to the number ofbuffers allocated to the first, second, third and/or fourth bufferclasses reaching the respective maximum allowable number of buffers. Forexample, the number of protected buffers decreases as the number ofbuffers allocated to a buffer class gets closer to the respectivemaximum allowable number of buffers.

The above described buffer management scheme, which may include forcinga buffer class to return some buffers before allocating more buffers,has several advantages. Firstly, the scheme ensures that that therequesting buffer class is working properly because buffers are recycledto indicate that the requesting buffer class is not stuck in aborrow-only state. Secondly, the scheme provides increasingdelay/resistance as a buffer class grows above its allowance (andencroaches into other buffer classes), while still allowing therequesting buffer class to grow when other classes have unutilized orlendable buffers. Thirdly, when a dormant buffer class is reactivated,the reactivated buffer class should have some buffers to start workingwith (coming from reserved/guaranteed pools), and eventually, LendingPolicy 3 ensures that other buffer classes shrink so that thereactivated buffer class can now grow. Finally, even while the otherbuffer classes are shrinking, the borrowing buffer classes can stillallocate some buffers (maybe after returning a lot more), which reducesI/O timeouts.

It should be understood that there can be several variations of theinventive concepts discussed above, including variations in a number ofbuffer classes, number and classifications of regions for a given bufferclass (e.g., reserved, guaranteed, protected, etc.), and variations inthe number and interpretations of lending policies. For example, insteadof forcing an oversubscribed buffer class to return some buffers, alending policy could require the requesting buffer class to wait for aperiod of time, skip some buffer allocation cycles, and/or the like.

While example embodiments have been described for buffers in a cachedenvironment, example embodiments may apply to other kinds resourcemanagement, such as frame management or the like.

It should be appreciated that example embodiments provide aself-controlled feedback based buffer management solution that hasseveral advantages: i) reduced buffer waste—if a buffer class is notactive, its lendable and protected regions can be used by an activebuffer class; ii) buffer movement from buffer class to buffer classoccurs smoothly based on actual demand—no manual intervention/pollingneeded; iii) buffer starving is reduced for the borrowing buffer classand/or the lending buffer classes, and each buffer class can proceedunder all circumstances; and iv) a user can have fined grained controlon buffer class behavior by configuring the classifications and lendingpolicies in advance and/or in real time without the need to constantlymonitor the system (i.e., once configured, the system runsautonomously).

Specific details were given in the description to provide a thoroughunderstanding of the embodiments. However, it will be understood by oneof ordinary skill in the art that the embodiments may be practicedwithout these specific details. In other instances, well-known circuits,processes, algorithms, structures, and techniques may be shown withoutunnecessary detail in order to avoid obscuring the embodiments.

While illustrative embodiments of the disclosure have been described indetail herein, it is to be understood that the inventive concepts may beotherwise variously embodied and employed, and that the appended claimsare intended to be construed to include such variations, except aslimited by the prior art.

1. A method for managing buffers in a cached environment, the methodcomprising: providing a pool of buffers, the pool of buffers comprisinga plurality of buffers that are allocatable to a number of differentbuffer classes; establishing a first buffer class that includes a firstmaximum allowable number of buffers that are allocatable thereto fromthe pool of buffers, the first buffer class further comprising a firstreserved number of buffers that are reserved for the first buffer classin the pool of buffers even if no Input/Output (I/O) operation isrunning in connection with the first buffer class; establishing a secondbuffer class that includes a second maximum allowable number of buffersthat are allocatable thereto from the pool of buffers, the second bufferclass further comprising a second reserved number of buffers that arereserved for the second buffer class in the pool of buffers even if noI/O operation is running in connection with the second buffer class; andenabling the first buffer class to have more than the first maximumallowable number of buffers allocated thereto from the pool of buffersas long as a number of buffers allocated to the second buffer class isfewer than the second maximum allowable number of buffers.
 2. The methodof claim 1, wherein a first buffer allocation count is maintained forthe first buffer class that indicates a current number of buffersallocated to the first buffer class from the pool of buffers, andwherein a second buffer allocation count is maintained for the secondbuffer class that indicates a current number of buffers allocated to thesecond buffer class from the pool of buffers.
 3. The method of claim 2,wherein a first buffer-to-be-returned count is maintained for the firstbuffer class that indicates a number of buffers that need to be returnedto the pool of buffers before the first buffer class is allowed to havemore buffers allocated thereto.
 4. The method of claim 1, furthercomprising: establishing a third buffer class that includes a thirdmaximum allowable number of buffers that are allocatable thereto fromthe pool of buffers, the third buffer class further comprising a thirdreserved number of buffers that are reserved for the third buffer classin the pool of buffers even if no I/O operation is running in connectionwith the third buffer class; establishing a fourth buffer class thatincludes a fourth maximum allowable number of buffers that areallocatable thereto from the pool of buffers, the fourth buffer classfurther comprising a fourth reserved number of buffers that are reservedfor the fourth buffer class in the pool of buffers even if no I/Ooperation is running in connection with the fourth buffer class; andenabling one or more of the first, second, third, and fourth bufferclasses to freely borrow buffers from one another as long as at leastone of the buffer classes having a buffer borrowed therefrom comprisesan allocated number of buffers that is fewer than the respective maximumallowable number of buffers.
 5. The method of claim 4, wherein thefirst, second, third, and fourth buffer classes are allocated for fast,medium, slow, and low-latency buffer operations, respectively.
 6. Themethod of claim 4, further comprising: maintaining one or more bufferlending policies in connection with one or more of the first, second,third, and fourth buffer classes, the one or more buffer lendingpolicies enabling buffer lending between buffer classes even if a bufferclass has more buffers allocated thereto than is allowed by therespective maximum allowable number of buffers.
 7. The method of claim1, further comprising: maintaining a first number of guaranteed buffersfor the first buffer class, the first number of guaranteed buffers beingchangeable in response to an amount of I/O activity experienced by thefirst buffer class.
 8. The method of claim 7, wherein the first numberof guaranteed buffers is greater than the first reserved number ofbuffers.
 9. The method of claim 7, further comprising: maintaining afirst number of protected buffers for the first buffer class, the firstnumber of protected buffers being changeable in response to the numberof buffers allocated to the first buffer class reaching the firstmaximum allowable number of buffers, wherein the first number ofprotected buffers decreases as the number of buffers allocated to thefirst buffer class gets closer to the first maximum allowable number ofbuffers.
 10. The method of claim 1, wherein the first maximum allowablenumber of buffers is dynamically configurable by firmware of a storagecontroller based on I/O activity of the first buffer class and secondbuffer class.
 11. A storage controller, comprising: a cache including apool of buffers; at least one host interface to receive, from a host,requests to perform I/O operations; a processor; and a memory coupled tothe processor and including processor executable instructions, theinstructions including: buffer manager instructions to assign the poolof buffers to a first buffer class and a second buffer class such thati) the first buffer class includes a first maximum allowable number ofbuffers that are allocatable thereto from the pool of buffers, ii) thefirst buffer class includes a first reserved number of buffers that arereserved for the first buffer class in the pool of buffers even if no(I/O) operation is running in connection with the first buffer class,iii) the second buffer class includes a second maximum allowable numberof buffers that are allocatable thereto from the pool of buffers, andiv) the second buffer class includes a second reserved number of buffersthat are reserved for the second buffer class in the pool of bufferseven if no I/O operation is running in connection with the second bufferclass, wherein the buffer manger instructions enable the first bufferclass to have more than the first maximum allowable number of buffersallocated thereto from the pool of buffers as long as a number ofbuffers allocated to the second buffer class is fewer than the secondmaximum allowable number of buffers.
 12. The storage controller of claim11, further comprising: one or more registers to maintain a first bufferallocation count for the first buffer class that indicates a currentnumber of buffers allocated to the first buffer class from the pool ofbuffers, and to maintain a second buffer allocation count for the secondbuffer class that indicates a current number of buffers allocated to thesecond buffer class from the pool of buffers.
 13. The storage controllerof claim 11, wherein the buffer manager instructions further compriseinstructions to assign the pool of buffers to a third buffer class and afourth buffer class such that i) the third buffer class includes a thirdmaximum allowable number of buffers that are allocatable thereto fromthe pool of buffers, ii) the third buffer class includes a thirdreserved number of buffers that are reserved for the third buffer classin the pool of buffers even if no I/O operation is running in connectionwith the third buffer class, iii) the fourth buffer class includes afourth maximum allowable number of buffers that are allocatable theretofrom the pool of buffers, and iv) the fourth buffer class includes afourth reserved number of buffers that are reserved for the fourthbuffer class in the pool of buffers even if no I/O operation is runningin connection with the fourth buffer class, and wherein the buffermanager instructions enable one or more of the first, second, third, andfourth buffer classes to freely borrow buffers from one another as longas at least one of the buffer classes having a buffer borrowed therefromcomprises an allocated number of buffers that is fewer than therespective maximum allowable number of buffers.
 14. The storagecontroller of claim 13, further comprising: one or more registers tomaintain one or more buffer lending policies in connection with one ormore of the first, second, third, and fourth buffer classes, the one ormore buffer lending policies enabling buffer lending between bufferclasses even if a buffer class has more buffers allocated thereto thanis allowed by the respective maximum allowable number of buffers. 15.The storage controller of claim 14, wherein the one or more registersmaintain a first buffer-to-be-returned count for each of the one or morebuffer lending policies that indicates a number of buffers that need tobe returned to the pool of buffers before a buffer class is allowed tohave more buffers allocated thereto.
 16. The storage controller of claim13, further comprising: one or more registers to maintain a number ofguaranteed buffers for the first, second, third, and fourth bufferclasses, the number of guaranteed buffers being changeable in responseto an amount of I/O activity experienced by the first, second, third,and fourth buffer classes.
 17. A storage system, comprising: a pool ofbuffers; one or more storage devices; and a storage controller to readand write data from/to the one or more storage devices using the pool ofbuffers, wherein the storage controller includes: a processor; and amemory coupled to the processor and including processor executableinstructions, the instructions including: buffer manager instructions toassign the pool of buffers to a first buffer class and a second bufferclass such that i) the first buffer class includes a first maximumallowable number of buffers that are allocatable thereto from the poolof buffers, ii) the first buffer class includes a first reserved numberof buffers that are reserved for the first buffer class in the pool ofbuffers even if no read or write operation is running in connection withthe first buffer class, iii) the second buffer class includes a secondmaximum allowable number of buffers that are allocatable thereto fromthe pool of buffers, and iv) the second buffer class includes a secondreserved number of buffers that are reserved for the second buffer classin the pool of buffers even if no read or write operation is running inconnection with the second buffer class, wherein the buffer mangerinstructions enable the first buffer class to have more than the firstmaximum allowable number of buffers allocated thereto from the pool ofbuffers as long as a number of buffers allocated to the second bufferclass is fewer than the second maximum allowable number of buffers. 18.The storage system of claim 17, wherein the buffer manager instructionsfurther comprise instructions to assign the pool of buffers to a thirdbuffer class and a fourth buffer class such that i) the third bufferclass includes a third maximum allowable number of buffers that areallocatable thereto from the pool of buffers, ii) the third buffer classincludes a third reserved number of buffers that are reserved for thethird buffer class in the pool of buffers even if no I/O operation isrunning in connection with the third buffer class, iii) the fourthbuffer class includes a fourth maximum allowable number of buffers thatare allocatable thereto from the pool of buffers, and iv) the fourthbuffer class includes a fourth reserved number of buffers that arereserved for the fourth buffer class in the pool of buffers even if noI/O operation is running in connection with the fourth buffer class, andwherein the buffer manager instructions enable one or more of the first,second, third, and fourth buffer classes to freely borrow buffers fromone another as long as at least one of the buffer classes having abuffer borrowed therefrom comprises an allocated number of buffers thatis fewer than the respective maximum allowable number of buffers. 19.The storage system of claim 18, wherein the first, second, third, andfourth buffer classes are allocated for fast, medium, slow, andlow-latency buffer operations, respectively.
 20. The storage system ofclaim 18, further comprising: one or more registers to at least one of:maintain one or more buffer lending policies in connection with one ormore of the first, second, third, and fourth buffer classes, the one ormore buffer lending policies enabling buffer lending between bufferclasses even if a buffer class has more buffers allocated thereto thanis allowed by the respective maximum allowable number of buffers;maintain a buffer-to-be-returned count for each of the one or morebuffer lending policies that indicates a number of buffers that need tobe returned to the pool of buffers before a buffer class is allowed tohave more buffers allocated thereto; maintain a number of guaranteedbuffers for the first, second, third, and fourth buffer classes,respectively, the number of guaranteed buffers being changeable inresponse to an amount of I/O activity experienced by the first, second,third, and fourth buffer classes; maintain a buffer allocation count foreach of the first, second, third, and fourth buffer classes thatindicates a current number of buffers allocated to the first, second,third, and fourth buffer classes from the pool of buffers, respectively;and maintain a number of protected buffers for the first, second, third,and fourth buffer classes, respectively, the number of protected buffersbeing changeable in response to the number of buffers allocated to thefirst, second, third and fourth buffer classes reaching the respectivemaximum allowable number of buffers, wherein the number of protectedbuffers decreases as the number of buffers allocated to a buffer classgets closer to the respective maximum allowable number of buffers.